<?php
class View {
    protected $_menu = array('Overzicht','Help');
    protected $_controller='Overzicht';
    protected $_data = array();
    protected $_weergave = array("inhoud"=>"kiekeboe");
            function __construct(){      
    }
    public function weergave($controller='',$actie='Index'){
        if(empty($controller)){
            die('view weergave');
        }else{
            $this->_controller=$controller;
            $view = implode(OSDS, array('app','views',$controller,$actie.'.php'));
            require_once $view;
            $template = implode(OSDS, array('public','template','template.php'));
            require_once($template);
        } 
    }
    protected function _getMenu(){
        $html = array('<ul class="nav navbar-nav pull-right">');
        foreach ($this->_menu as $controller) {
            array_push($html,'<li');
            if($controller == $this->_controller){
                array_push($html,' class="active" ');
            }
            array_push($html,'><a href="/'.$controller.'">'.$controller.'</a></li>');
        }
        array_push($html,'</ul>');
        return implode($html);
    }
    protected function zet($key='',$inhoud=''){
        if(!empty($key)){
            $key = strtolower($key);
            $this->_weergave[$key]=$inhoud;
        }
        
    }
    protected function haal($key=''){
        if(!empty($key)){
            $key = strtolower($key);
            if(isset($this->_weergave[$key])){
                return $this->_weergave[$key];
            }
        }
        return '';
    }
}